package org.westos.ChinaSoft3;

import java.util.Objects;

public class Employee implements Cloneable {

    private Integer id;
    private String name;
    private int age;
    private String sex;
    private int SA;

    public Employee() {
    }

    public int getSA() {
        return SA;
    }

    public void setSA(int SA) {
        this.SA = SA;
    }

    public Employee(int id, String name, int age, String sex, int SA) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.SA = SA;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee emp = (Employee) o;
        return id == emp.id &&
                age == emp.age &&
                sex == emp.sex &&
                SA == emp.SA &&
                Objects.equals(name, emp.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, age, sex, SA);
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", SA=" + SA +
                '}';
    }

    @Override
    public Object clone() throws CloneNotSupportedException {

        Employee employee = null;
        try {
            employee = (Employee) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return employee;
    }




}
